package lab02.test19;

public class Test {
    public static void main(String[] args) {
        //19、 	编写一个程序，实现字符串的大小写转换并倒序输出
        char[] a = new char[9];
        a[0] = 'H';
        a[1] = 'e';
        a[2] = 'l';
        a[3] = 'l';
        a[4] = 'o';
        a[5] = 'W';
        a[6] = 'o';
        a[7] = 'r';
        a[8] = 'd';
        int i ;
        char tmp;
        for (i = 8; i>=0; i--) {
            tmp = a[i];
            if (tmp >= 'A' && tmp <= 'Z') {
                System.out.print((char) (tmp + 32));
            } else if (tmp >= 'a' && tmp <= 'z') {
                System.out.print((char) (tmp - 32));
            }
        }
    }
}
